<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
   
    <script>
        let name='zs'
        let age=19

        //如果对象里面的key 与val 相同 则可以只写一个
    //    let obj={
    //        name:name,
    //        age:age,
    //    }
    let obj={
        name,
        age
    }
       console.log(obj)


{
    
    let obj2={name:'zss',age:100};
       let {name,age}=obj2;
    // let {name:name,age:age}={name:'zs',age:100}
     console.log(name)
     console.log(age)

}
    </script>

</body>
</html>